package com.timothy.business.util;

import org.apache.shiro.crypto.hash.SimpleHash;
import org.apache.shiro.util.ByteSource;

public class PasswordHelper {

	private static final String algorithmName = "md5";
	private static final int hashIterations = 2;

	public static String encryptPassword(String password, String salt) {
		String encryptPassword = new SimpleHash(algorithmName, password, ByteSource.Util.bytes(salt), hashIterations)
				.toHex();
		return encryptPassword;
	}

}
